package com.ag.hmk.service.impl;

import java.util.List;

import com.ag.bean.TbTeam;
import com.ag.common.IDUtil;
import com.ag.hmk.dao.HmkTbTeamDAO;
import com.ag.hmk.service.TbTeamService;

/**
 * 
 * @author 黄木看
 * 救援队伍库服务接口实现类
 *
 */
public class TbTeamServImpl implements TbTeamService {

	

	private HmkTbTeamDAO hmkTbTeamDAO;
	
	/*
	 * 删除一条救援队伍记录
	 */
	public void delTeam(TbTeam tbTeam) {
		if (tbTeam!=null) {
			tbTeam.setA(IDUtil.DELETE);
			hmkTbTeamDAO.attachDirty(tbTeam);
		}
	}

	/*
	 * 查询所有救援队伍信息
	 */
	public List<TbTeam> findAllTeam() {
		return hmkTbTeamDAO.findAll();
	}

	/*
	 * 查询一条救援队伍记录
	 */
	public TbTeam findTeamByID(String teamID) {
		if (teamID!=null) {
			return hmkTbTeamDAO.findById(teamID);
		}else {
			return null;
		}
		
	}

	/*
	 * 保存一条救援队伍记录(新增或更新都可以)
	 */
	public void saveTeam(TbTeam tbTeam) {
		if (tbTeam!=null) {
			tbTeam.setA(IDUtil.PRESERVE);
			hmkTbTeamDAO.attachDirty(tbTeam);
		}
		
	}


	
	public void setHmkTbTeamDAO(HmkTbTeamDAO hmkTbTeamDAO) {
		this.hmkTbTeamDAO = hmkTbTeamDAO;
	}


}
